<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>创建管理员账户</title>
    <link href="{{ static_url('css/bootstrap.css') }}" rel="stylesheet">
    <link href="{{ static_url('css/common.css') }}" rel="stylesheet">
</head>
<body background="{{ static_url('images/background.jpg') }}">
<div class="container login-page">
    <div class="row">
        <div class="col-md-4 col-lg-offset-4">
            {% if handler.has_message() %}
                {% for message in handler.read_messages() %}
                    <div class="alert alert-{{ message['category'] }} alert-dismissable">
                        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                        {{ message['message'] }}
                    </div>
                {% end %}
            {% end %}
            <h3 class="text-center">创建管理员账户</h3>
            <form class="form-horizontal" role="form" method="post"
                  onsubmit="return checkPasswordForm()" action="{{ reverse_url('super.init') }}">
                {% module xsrf_form_html() %}
                <div class="form-group">
                    <label for="username">用户名</label>
                    <input class="form-control" id="username" required name="username" type="text" >
                </div>
                <div class="form-group">
                    <label for="email">邮箱</label>
                    <input class="form-control" id="email" required name="email" type="text" >
                </div>
                <div class="form-group">
                    <label for="password">密码</label>
                    <input class="form-control" id="password" required name="password" type="password" >
                </div>
                <div id="group_password2" class="form-group">
                    <label for="password2">密码确认</label>
                    <input class="form-control" id="password2" required name="password2" type="password" >
                    <span id="password2_err" class="help-block" style="display: none">两次密码不一致</span>
                </div>
                <button id="changePasswordCfmClick" type="submit" class="btn btn-success">创建账户</button>
            </form>
        </div>
    </div>
</div>
<script src="{{ static_url('js/super.js') }}"></script>
<script src="{{ static_url('js/jquery-2.2.1.min.js') }}"></script>
<script src="{{ static_url('js/bootstrap.min.js') }}"></script>
</body>
</html>